package com.hangim.pce.service.impl;

import com.hangim.pce.mapper.SysDrugRuleMapper;
import com.hangim.pce.model.SysDrugRule;
import com.hangim.pce.service.SysDrugRuleService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.hangim.pce.common.service.impl.BaseEntityServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 药品规则表 服务实现类
 * </p>
 *
 * @author hongjiliang
 * @since 2018-10-19
 */
@Service
public class SysDrugRuleServiceImpl extends BaseEntityServiceImpl<SysDrugRuleMapper, SysDrugRule> implements SysDrugRuleService {

    @Override
    public List<SysDrugRule> getDrugRulesByName(String name) {
        return mapper.selectList(new EntityWrapper<SysDrugRule>().eq("drug_name", name));
    }

    @Override
    public List<SysDrugRule> getDrugRulesByDrugId(Long drugId) {
        return mapper.selectList(new EntityWrapper<SysDrugRule>().eq("drug_id", drugId));
    }
}
